HA$PBExportHeader$u_cst_mcorrelativo_cabedet.sru
forward
global type u_cst_mcorrelativo_cabedet from u_cst_mantocabedet
end type
end forward

global type u_cst_mcorrelativo_cabedet from u_cst_mantocabedet
end type
global u_cst_mcorrelativo_cabedet u_cst_mcorrelativo_cabedet

on u_cst_mcorrelativo_cabedet.create
int iCurrent
call super::create
end on

on u_cst_mcorrelativo_cabedet.destroy
call super::destroy
end on

event ue_nuevo;call super::ue_nuevo;

dw_1.object.data[1,1] = of_getCodigoInt(is_tabla)
end event

event ue_agregar;integer li_row

li_row =  dw_3.rowcount() 
dw_3.scrolltorow(dw_3.insertrow( 0))
if li_row = 0 then
	dw_3.object.idindice [1]=	1
else
	dw_3.object.idindice [dw_3.rowcount()]=	dw_3.object.idindice [li_row]+1
end if
dw_3.object.idcorrelativo[dw_3.rowcount()] =dw_1.object.idcorrelativo[1]

dw_3.object.idserie[dw_3.rowcount()] =dw_1.object.idserie[1]
dw_3.object.iddocu[dw_3.rowcount()] =dw_1.object.iddocu[1]

end event

event ue_setdwc;//choose case is_tabla
//	case 'MMOVIMIENTO'
			dw_2.GetChild("iddocu", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
//			dw_2.GetChild("idtrans", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
//			dw_2.GetChild("idalma", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
//			dw_2.GetChild("idcentro", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
end event

event ue_editar;iuo_tabmantomain.event ue_setbutton(is_button)
iuo_tabmantomain.event	ue_set_ib_sw(true)

iuo_grillamain.event ue_activa_opc( true)
event ue_settabtext ('Editar '+ is_entidad)
event ue_cambio_opc('EDITAR')
is_columna = dw_1.describe('#'+string(1)+'.name')
is_tipocolumna = dw_1.describe(is_columna+'.coltype')	

//dw_3.GetChild("iditem", dwc);dwc.reset()
//gdc_mitem1.RowsCopy(gdc_mitem1.GetRow(), gdc_mitem1.RowCount(), Primary!, dwc, 1, Primary!)

if left(is_tipocolumna,4)='char' then
	 is_codigo =dw_2.object.data[1,1]
	 of_retrieve( is_codigo)	
elseif is_tipocolumna='int' then
	 ii_codigo =dw_2.object.data[1,1]
	 of_retrieve( ii_codigo)	
else
	il_codigo =dw_2.object.data[1,1]
	 of_retrieve( il_codigo)	
end if		
end event

type dw_5 from u_cst_mantocabedet`dw_5 within u_cst_mcorrelativo_cabedet
end type

type dw_4 from u_cst_mantocabedet`dw_4 within u_cst_mcorrelativo_cabedet
string dataobject = "d_mcorrelativod_tabular"
end type

type dw_3 from u_cst_mantocabedet`dw_3 within u_cst_mcorrelativo_cabedet
end type

type st_det2 from u_cst_mantocabedet`st_det2 within u_cst_mcorrelativo_cabedet
end type

type st_det1 from u_cst_mantocabedet`st_det1 within u_cst_mcorrelativo_cabedet
end type

type st_titulo from u_cst_mantocabedet`st_titulo within u_cst_mcorrelativo_cabedet
end type

type dw_2 from u_cst_mantocabedet`dw_2 within u_cst_mcorrelativo_cabedet
string dataobject = "d_mcorrelativo_free"
end type

type uo_toolbarstrip from u_cst_mantocabedet`uo_toolbarstrip within u_cst_mcorrelativo_cabedet
end type

type dw_1 from u_cst_mantocabedet`dw_1 within u_cst_mcorrelativo_cabedet
end type

type uo_1 from u_cst_mantocabedet`uo_1 within u_cst_mcorrelativo_cabedet
end type

